package com;

import java.util.Properties;
import java.util.Set;

public class Test13 {
    public static void main(String[] args) {
        Properties pp = new Properties();

        pp.setProperty("张三", "李四");
        pp.setProperty("王五", "赵六");
        pp.setProperty("前妻", "下巴");

        String value1 = pp.getProperty("张三");
        System.out.println("value1 = " + value1);
        String value2 = pp.getProperty("宣思");
        System.out.println("value2 = " + value2);

        String value3 = pp.getProperty("王五", "可不能输");
        System.out.println("value3 = " + value3);
        String value4 = pp.getProperty("宣思", "苏八月");
        System.out.println("value4 = " + value4);

        System.out.println("=========================");

        Set<String> s = pp.stringPropertyNames();
        for (String s1 : s) {
            String value = pp.getProperty(s1);
            System.out.println(s1 + "=" + value);
        }
    }
}
